﻿using Microsoft.Extensions.ObjectPool;
using Serilog;
using System;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;

namespace ObjectPoolProj
{
    class Program
    {

        static void Main(string[] args)
        {
            Serilog.Log.Logger = new LoggerConfiguration().WriteTo.Console().CreateLogger();


            var srs = Assembly.GetExecutingAssembly().GetTypes();

            foreach (var sr in srs)
            {
                if (sr.IsClass && typeof(IService).IsAssignableFrom(sr))
                {
                    Log.Information("{0} Class", sr.Name);
                    (Activator.CreateInstance(sr) as IService).Run();
                    Log.Information("====================================================");
                }
            }
        }
    }
}
